package edu.gatech.wms.junits;

import android.test.AndroidTestCase;
import edu.gatech.wms.controllers.UserManager;
import edu.gatech.wms.models.User;

public class GinoJUnit extends AndroidTestCase {

	private static int	userID1, userID2;
	
	/**
	 * Directly bypassing usermanager and adding users directly into database
	 * system
	 */
	public void test1Setup() {
		userID1 = 23214312;
		userID2 = 23214313;
		
		int result1 = UserManager.dbMain.add(new User( "Fake", "User", userID1, "PASS!WWWWWW", "fake@user.net", false));
		int result2 = UserManager.dbMain.add(new User( "Fake2", "User2", userID2, "PASS!WWWWW2", "fake2@user.net", true));
		
		assertEquals(userID1, result1);
		assertEquals(userID2, result2);
	}
	
	public void test2Remove() {
		assertTrue(UserManager.deleteUser(userID1));
	}
	
	public void test3Remove() {
		assertTrue(UserManager.deleteUser(userID2));
	}
	
	public void test4RemoveNull() {
		assertFalse(UserManager.deleteUser(0));
	}
	
	public void test5RemoveBadNum() {
		assertFalse(UserManager.deleteUser(777999));
	}
	
}
